package com.unknowpupil.design.cor;

import java.util.List;

/**
 * @Description: <p>
 * 抽象类。领导
 * </p>
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/4/28 11:56
 * @Classname: Leader
 * @Version: 1.0
 */
public abstract class Leader {
    protected String name;
    /**
     * 责任链上的后续对象
     */
    protected Leader nextLeader;


    public Leader(String name) {
        this.name = name;
    }



    /**
     * 设定责任链上的后续对象。
     * 提供set 方法</br>
     *
     * @param nextLeader {@link Leader} 责任链上的后续对象
     */
    public void setNextLeader(Leader nextLeader) {
        this.nextLeader = nextLeader;
    }

    /**
     * 处理请求的核心业务方法
     *
     * @param request {@link LeaveRequest}  请假对象
     */
    public abstract void handleRequest(LeaveRequest request);
}
